package com.xindaoapp.framework.base;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
import com.xindaoapp.framework.MainActivity;

public abstract class BaseFragment extends Fragment {

	public Context ct;
	public SlidingMenu sm;
    public boolean isLoadSuccess = false;
	@Override
	public void onActivityCreated(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onActivityCreated(savedInstanceState);
		initData();
	}



	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		ct = getActivity();
		sm = ((MainActivity)ct).getSlidingMenu();
	}
    /*
     * setContentView();
     */
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = initView(inflater);
		return view;
	}


	/**
     *   这个方法主要是初始化view
	 * @param inflater 
     */
	public abstract View initView(LayoutInflater inflater);
    /**
     *   这个方法主要是初始化初始化数据，进行从服务器拉去数据
     */
	public abstract void initData() ;

}
